package samples;

import java.util.Scanner;

import timesheets.Przelicznik;

public class Person {
	  private final String name;
	  private final int age;
	     
	  /**
	   * Creates a person with the specified name and age.
	   *
	   * @param name the name
	   * @param age the age
	   * @throws IllegalArgumentException if the age is not greater than zero
	   */
	  public Person(String name, int age) {
	    this.name = name;
	    this.age = age;
	    if (age <= 0) {
	      throw new IllegalArgumentException("Invalid age:" + age);
	    }
	  }
	  
	  
		public static boolean returnTrueIfGivenNumberGreaterThanZero2() {
			Scanner keyboard = new Scanner(System.in);
			boolean greaterThanZero = false;

			System.out.println("Podaj liczbę:");
			String liczbas = keyboard.nextLine();
			double liczba = Przelicznik.skonwertujStringToDouble(liczbas);
			if (liczba > 0) {
				greaterThanZero = true;
				System.out.println(liczba + " > 0");
			} else {
				System.out.println(liczba + " <= 0");
			}
			return greaterThanZero;
		}
	}